#include <stdio.h>
int bin_search(int arr[], int left, int right, int key)
{
	int mid;
	while(left<=right)
	{
	mid=left+right/2;
	if(arr[mid]>key)
	right=mid-1;
	else if(arr[mid]<key)
	left=mid+1;
	else
	return mid;
	}
	return -1;
}
int main()
{
	int arr[10]={1,3,5,7,9,11,13,15,16,17};
	int a=bin_search(arr,0,9,17);
	printf("%d",a);
	return 0;
}
